#include "Color.h"

namespace hgui
{
	Color::Color(const Color& v)
	{
		r = v.r;
		g = v.g;
		b = v.b;
		a = v.a;
	}

	Color& Color::operator += (const Color& v)
	{
		r += v.r;
		g += v.g;
		b += v.b;
		a += v.a;
		return *this;
	}

	Color& Color::operator -= (const Color& v)
	{
		r -= v.r;
		g -= v.g;
		b -= v.b;
		a -= v.a;
		return *this;
	}

	Color& Color::operator *= (const Color& v)
	{
		r *= v.r;
		g *= v.g;
		b *= v.b;
		a *= v.a;
		return *this;
	}

	Color& Color::operator /= (const Color& v)
	{
		r /= v.r;
		g /= v.g;
		b /= v.b;
		a /= v.a;
		return *this;
	}

	Color Color::operator + (const Color& v)
	{
		Color clr(*this);
		clr.r += v.r;
		clr.g += v.g;
		clr.b += v.b;
		clr.a += v.a;
		return clr;
	}

	Color Color::operator + (UInt32 v)
	{
		Color clr(*this);
		clr.r += v;
		clr.g += v;
		clr.b += v;
		clr.a += v;
		return clr;
	}

	Color Color::operator - (const Color& v)
	{
		Color clr(*this);
		clr.r -= v.r;
		clr.g -= v.g;
		clr.b -= v.b;
		clr.a -= v.a;
		return clr;
	}

	Color Color::operator - (UInt32 v)
	{
		Color clr(*this);
		clr.r -= v;
		clr.g -= v;
		clr.b -= v;
		clr.a -= v;
		return clr;
	}

	Color& Color::operator = (const Color& v)
	{
		r = v.r;
		g = v.g;
		b = v.b;
		a = v.a;
		return *this;
	}

	Color& Color::operator = (UInt32 v)
	{
		r = g = b = v;
		return *this;
	}

	bool Color::operator == (const Color& v)
	{
		return (	(r == v.r) &&
					(g == v.g) &&
					(b == v.b) &&
					(a == v.a));
	}

	bool Color::operator == (UInt32 v)
	{
		return (	(r == v) &&
					(g == v) &&
					(b == v) &&
					(a == v));
	}

	bool Color::operator != (const Color& v)
	{
		return (	(r != v.r) &&
					(g != v.g) &&
					(b != v.b) &&
					(a != v.a));
	}

	bool Color::operator != (UInt32 v)
	{
		return (	(r != v) &&
					(g != v) &&
					(b != v) &&
					(a != v));
	}
} // namespace hgui